<#include "top.ftl" >
<#include "manage_top.ftl">
<script type="text/javascript" src="js/manage.js" ></script>
<html>
	<body>
		<div class="middle">
			<table id="anime" title="动漫" url="animeManage/getAnimes" rownumbers="true" 
			pagination="true" singleSelect="true" fitColumns="true" toolbar="#animeToolbar" 
			idField="id" style="height:365px">
				<thead>
					<tr>
						<th data-options="field:'code'">${i18n.getText("anime_code")}</th>
						<th data-options="field:'name'">${i18n.getText("anime_name")}</th>
						<th data-options="field:'type',formatter:getType">${i18n.getText("anime_type")}</th>
						<th data-options="field:'cover_url'">${i18n.getText("anime_cover_url")}</th>
						<th data-options="field:'baike_url'">${i18n.getText("anime_baike_url")}</th>
						<th data-options="field:'state',formatter:getState">${i18n.getText("anime_state")}</th>
					</tr>
				</thead>
				<div id="animeToolbar">
					${i18n.getText("anime_code")}:<input id="animeCode" class="easyui-validatebox" type="text" name="code"/>
					${i18n.getText("anime_name")}:<input id="animeName" class="easyui-validatebox" type="text" name="name"/>
					<a id="animeSearch" class="easyui-linkbutton" iconCls="icon-search">${i18n.getText("search")}</a>
					<a id="addAnime" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true">${i18n.getText("add")}</a>
					<a id="editAnime" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true">${i18n.getText("edit")}</a>
					<a id="deleteAnime" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true">${i18n.getText("delete")}</a>
				<div>
			</table>
			<table id="episode" title="动漫明细" rownumbers="true" fitColumns="true" toolbar="#episodeToolbar" 
			pagination="true" style="height:365px">
				<thead>
					<tr>
						<th data-options="field:'num',editor:{type:'numberspinner',options:{required:true}}">${i18n.getText("episode_num")}</th>
						<th data-options="field:'name',editor:{type:'text'}">${i18n.getText("episode_name")}</th>
						<th data-options="field:'url1',editor:{type:'text'}">${i18n.getText("episode_url1")}</th>
						<th data-options="field:'url2',editor:{type:'text'}">${i18n.getText("episode_url2")}</th>
						<th data-options="field:'url3',editor:{type:'text'}">${i18n.getText("episode_url3")}</th>
						<th data-options="field:'url4',editor:{type:'text'}">${i18n.getText("episode_url4")}</th>
						<th data-options="field:'url5',editor:{type:'text'}">${i18n.getText("episode_url5")}</th>
						<th data-options="field:'url6',editor:{type:'text'}">${i18n.getText("episode_url6")}</th>
						<th data-options="field:'date',formatter:formatDataTimeForCell,options:{required:true},editor:{type:'datetimebox'}">${i18n.getText("episode_date")}</th>
					</tr>
				</thead>
				<div id="episodeToolbar">
					<a id="addEpisode" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true">${i18n.getText("add")}</a>  
			        <a id="deleteEpisode" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true">${i18n.getText("delete")}</a>  
			        <a id="saveEpisode" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-save" plain="true">${i18n.getText("save")}</a>  
			        <a id="cancelEpisode" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-undo" plain="true">${i18n.getText("cancel")}</a>
				</div>
			</table>
			<a id="cvEdit" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true">声优</a>
			<a id="typeEdit" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true">类型</a>
		</div>
		<script>
		function getState(value,row,index)
		{
			<#list states as state>
				if(value=='${state.dict_id}') return '${i18n.getText(state.dict_id)}';
			</#list>
		}
		function getType(value,row,index)
		{
			var types = "";
			for(var e in value)
			{
				types +=value[e].type_name+" ";
			}
			return types;
		}
		</script>
	</body>
</html>